package com.yvan.simple;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.LinkedHashMap;
import java.util.Map;

@RestController
public class RootController {

    @GetMapping("ok")
    public String ok() {
        return "ok";
    }

    @GetMapping("env")
    public Object env(Model model) {
        return System.getenv();
    }

    @GetMapping("domain")
    public Map<String, Object> domain() {
        Map<String, Object> r = new LinkedHashMap<>();
        r.put("path", System.getProperty("user.dir"));
        return r;
    }

}
